home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / coding / 80x86 / incd1asm.lzh / LOADER.ASM < prev    next >
Assembly Source File  |  1992-02-07  |  26KB  |  741 lines

  1. ;These signs are at you disposal in the text: a to z ( ) ! , . ' - * & "
  2. ;Remember you can only write in lower case when you are using a to z.
  3. ;You can write as much as you wish in the text below. Just remember to end
  4. ;the text with db 0 as showed!    Or else the text won't wrap around!
  5. ;-------------------------------------------------------------------------------
  6. SinusLength     equ     (128*2)*2     ;Don't alter any of these data!
  7. Source          equ     320*106+8     ;As the loader would fuck up!
  8. Source2         equ     320*124+8     ;
  9. Step            equ     5             ;
  10.  
  11.                 .model  small         ;
  12.                 dosseg                ;
  13.  
  14.                 .data
  15. ;-------------------------------------------------------------------------------
  16. Text            label   byte
  17.                 db      '   international network of crackers!   '
  18.                 db      'we bring you yet another quality release'
  19.                 db      '----------------------------------------'
  20.                 db      '  ** use this version of the loader **  '
  21.                 db      '     i have removed all known bugs!     '
  22.                 db      ' and all data is collected in one file! '
  23.                 db      '                                        '
  24.                 db      0     ;Marks end of text. DON'T FORGET!
  25. ;-------------------------------------------------------------------------------
  26. EndMessage      db      '(C) The International Network of Crackers 1992!',10,10,13
  27.                 db      'All programming by Xerox!',10,13
  28.                 db      'Original music by Drax of the Vibrants!',10,13
  29.                 db      'Adlib player & conversion by Jch of the Vibrants!',10,10,13,24h
  30. ;-------------------------------------------------------------------------------
  31. StartText       dw      0
  32. Delay2          db      0
  33. Pause           dw      0
  34. First           dw      0
  35. ColVar          db      9
  36. Check           db      2
  37. Fade            db      0
  38. _Si             dw      0
  39. _Di             dw      0
  40. Ditto1          dw      0
  41. Ditto2          dw      0
  42. ;-------------------------------------------------------------------------------
  43. LetterTabel     dw      Source+(16*00),Source+(16*01),Source+(16*02),Source+(16*03),Source+(16*04),Source+(16*05),Source+(16*06),Source+(16*07),Source+(16*08),Source+(16*09),Source+(16*10),Source+(16*11),Source+(16*12),Source+(16*13),Source+(16*14),Source+(16*15),Source+(16*16),Source+(16*17),Source+(16*18)
  44.                 dw      Source2+(16*00),Source2+(16*01),Source2+(16*02),Source2+(16*03),Source2+(16*04),Source2+(16*05),Source2+(16*06),Source2+(16*07),Source2+(16*08),Source2+(16*09),Source2+(16*10),Source2+(16*11),Source2+(16*12),Source2+(16*13),Source2+(16*14),Source2+(16*15),Source2+(16*16),Source2+(16*17),Source2+(16*18)
  45. ;-------------------------------------------------------------------------------
  46. SinusVar        db      0,0,0,0,0,0,0,0,0,0
  47.                 db      0,0,0,0,0,0,0,0,0,0
  48.                 db      0,0,0,0,0,0,0,0,0,0
  49.                 db      0,0,0,0,0,0,0,0,0,0
  50.  
  51. SinusData       dw      0,0,0,0,0,0,0,0,0,0
  52.                 dw      0,0,0,0,0,0,0,0,0,0
  53.                 dw      0,0,0,0,0,0,0,0,0,0
  54.                 dw      0,0,0,0,0,0,0,0,0,0
  55. ;-------------------------------------------------------------------------------
  56. DataFile        db      'datafile.inc',0
  57. ;-------------------------------------------------------------------------------
  58. UnpackedPicSeg  dw      0
  59. MusicSegment    dw      0
  60. ;-------------------------------------------------------------------------------
  61. Rgb1            db      0
  62. Rgb2            db      0
  63. Rgb3            db      0
  64.  
  65. PaletteData     Label byte
  66.                 db      00,00,00,51,51,59,35,35,47,23,23,43,19,19,47,07,11,31,03,03,27,00,00,19,59,59,59,59,59,55,59,59,51,59,59,47,59,59,43,59,59,39,59,59,35,59,59,31,59,59,27,59,55,23,55,51,23,55,47,19,51,43,19,51,39,15,51,35,15,47,31,11
  67.                 db      47,31,11,47,27,07,43,23,07,39,19,03,35,15,03,31,15,03,27,11,00,23,07,00,63,00,00,59,00,00,55,00,00,51,00,00,48,00,00,47,00,00,43,00,00,39,00,00,38,00,00,34,00,00,31,00,00,27,00,00,23,00,00,22,00,00,19,00,00,14,00,00
  68.                 db      63,52,52,63,44,44,63,39,39,63,31,31,63,23,23,63,15,15,63,07,07,63,00,00,63,42,23,63,38,15,63,34,07,63,30,00,55,27,00,51,23,00,43,21,00,39,19,00,63,63,52,63,63,44,63,63,39,63,63,31,63,60,23,63,59,15,63,59,07,63,59,00
  69.                 db      55,52,00,51,47,00,43,43,00,39,39,00,31,31,00,27,27,00,22,21,00,15,15,00,51,63,23,47,63,15,43,63,07,39,63,00,35,55,00,31,51,00,27,43,00,23,39,00,52,63,52,47,63,44,39,63,39,31,63,31,23,63,23,15,63,15,07,63,07,00,63,00
  70.                 db      00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
  71.                 db      00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
  72.                 db      00,00,11,00,00,11,00,00,11,00,00,11,00,00,11,00,00,11,00,00,11,00,00,13,00,00,13,00,00,13,00,00,13,00,00,14,00,00,14,00,00,14,00,00,14,00,00,15,59,52,63,55,44,63,52,39,63,51,31,63,48,23,63,47,15,63,43,07,63,42,00,63
  73.                 db      38,00,55,31,00,51,27,00,43,23,00,39,19,00,31,17,00,27,13,00,22,10,00,15,63,52,63,63,44,63,63,39,63,63,31,63,63,23,63,63,15,63,63,07,63,63,00,63,55,00,55,48,00,51,43,00,43,39,00,39,31,00,31,27,00,27,22,00,22,15,00,15
  74.                 db      63,56,55,63,55,51,63,52,47,63,51,47,63,51,43,63,47,39,63,47,39,63,44,35,63,43,31,63,39,27,63,39,23,59,35,23,56,35,22,55,34,21,51,31,19,48,31,19,47,30,18,43,27,17,42,26,15,39,23,15,39,23,14,35,23,13,34,22,11,31,19,11
  75.                 db      27,19,10,27,18,09,23,15,07,21,15,07,18,14,06,15,11,06,14,11,05,10,07,03,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,47,10,10,47,19,10,47,27,10,47,39,10,47,47,10,39,47,10,27,47,10,19,47,10
  76.                 db      10,47,11,10,47,23,10,47,34,10,47,43,10,42,47,10,31,47,10,19,47,11,10,47,22,10,47,31,10,47,43,10,47,47,10,43,47,10,31,47,10,21,47,10,10,63,63,63
  77. ;-------------------------------------------------------------------------------
  78. Sinus1          DW      36,38,40,41,43,45,46,48,49,51,52,54,55,57,58,59,60,62,63,64,65,65,66,67,67,68,68,69,69,69,69,69,69,69,69,69,68,68,67,67,66,65,65,64,63,62,60,59,58,57,55,54,52,51,49,48,46,45,43,41,40,38,36,34,33,31,29,28,26,24,23,21,20,18,17,15,14,12,11,10,9,7,6,5,4,4,3,2,2,1,1,0,0,0,0,0,0,0,0,0,1,1,2,2,3,4,4,5,6,7,9,10,11,12,14,15,17,18,20,21,23,24,26,28,29,31,33,34
  79.                 DW      36,38,40,41,43,45,46,48,49,51,52,54,55,57,58,59,60,62,63,64,65,65,66,67,67,68,68,69,69,69,69,69,69,69,69,69,68,68,67,67,66,65,65,64,63,62,60,59,58,57,55,54,52,51,49,48,46,45,43,41,40,38,36,34,33,31,29,28,26,24,23,21,20,18,17,15,14,12,11,10,9,7,6,5,4,4,3,2,2,1,1,0,0,0,0,0,0,0,0,0,1,1,2,2,3,4,4,5,6,7,9,10,11,12,14,15,17,18,20,21,23,24,26,28,29,31,33,34,36
  80. ;-------------------------------------------------------------------------------
  81. StartPos        dw      320*101
  82. EndPos          dw      320*10
  83. Antal           dw      0
  84. Book            dw      90
  85. ;-------------------------------------------------------------------------------
  86. SetError7       db      'Allocation error: '
  87.                 db      'Memory control blocks destroyed.$'
  88. SetError8       db      'Allocation error: '
  89.                 db      'Insufficient memory.$'
  90. SetError9       db      'Allocation error: '
  91.                 db      'Invalid memory block adress.$'
  92.  
  93. SetUnknown      db      'Unknown allocation error.$'
  94.  
  95.  
  96. DataBuffer      db      20786 dup (0)
  97.  
  98.  
  99.  
  100.                 .code
  101.                 .286
  102.  
  103. Player:         ret
  104.                 db      9ah,0,0
  105. Music           dw      0
  106.                 ret
  107. ;-------------------------------------------------------------------------------
  108. Start:          mov     ax,@data
  109.                 mov     ds,ax
  110.                 call    Reserve    ;Allocate memory needed
  111.                 call    Setup      ;precalculate data & etc.
  112. ;-------------------------------------------------------------------------------
  113. Main:           call    Waitraster
  114.  
  115.                 call    Dycp
  116.  
  117.                 mov     ah,3                 ;Play music
  118.                 call    Player
  119.  
  120.                 mov     cx,8                 ;Put INC logo onto screen!
  121. Network:        push    cx
  122.                 call    LogoShower
  123.                 pop     cx
  124.                 loop    Network
  125.  
  126.                 mov     ah,1                 ;Check for keypress
  127.                 int     16h
  128.                 je      Main
  129.                 mov     ah,0
  130.                 int     16h                  ;End main
  131. ;-------------------------------------------------------------------------------
  132. Terminate:      call    ClearInit
  133.  
  134.                 mov     es,UnpackedPicSeg
  135.                 call    Deallocate
  136.  
  137.                 mov     ax,3                ;Switch to normal graphics!
  138.                 int     10h
  139.                 mov     ah,9                ;Write EndMessage to screen
  140.                 lea     dx,EndMessage
  141.                 int     21h
  142.                 mov     ax,4c00h            ;Terminate program! Return to dos!
  143.                 int     21h
  144. ;-------------------------------------------------------------------------------
  145. DepackPicture:  mov     es,UnpackedPicSeg
  146.                 mov     ax,@data
  147.                 mov     ds,ax
  148.  
  149.                 lea     si,DataBuffer
  150.                 add     SI,3883            ;After player+data
  151.                 MOV     DI,0
  152.                 MOV     CX,200
  153.                 mov     al,0
  154.                 MOV     BP,320
  155.                 MOV     BX,0
  156.                 MOV     DX,8
  157.                 PUSH    AX
  158.                 MOV     AX,BP
  159.                 AND     AX,7
  160.                 SHR     BP,3
  161.                 CMP     AX,0
  162.                 JE      ax_0
  163.                 MOV     AX,1
  164. ax_0:           ADD     BP,AX
  165.                 SHR     BX,3
  166.                 POP     AX
  167.                 push    cx
  168.                 mov     cl,al
  169.                 mov     al,1
  170.                 shl     al,cl
  171.                 MOV     AH,AL
  172.                 NOT     AH
  173.                 pop     cx
  174. Depackl1:       PUSH    CX
  175.                 PUSH    AX
  176.                 MOV     CX,DX
  177. Planes:         PUSH    CX
  178.                 PUSH    DI
  179.                 PUSH    BP
  180. NotherOne:      XOR     CX,CX
  181.                 MOV     CL,DS:[SI]
  182.                 INC     SI
  183.                 CMP     CL,127
  184.                 JA      CrunchyNut
  185.                 INC     CX
  186.                 SUB     BP,CX
  187.                 push    bx
  188. PutByte:        mov     bl,ds:[si]
  189.                 inc     si
  190.                 push    cx
  191.                 mov     cx,8
  192. orpixel:        rcl     bl,1
  193.                 jc      carry_set
  194.                 and     es:[di],ah
  195.                 jmp     set_done
  196. carry_set:      or      es:[di],al
  197. set_done:       inc     di
  198.                 loop    orpixel
  199.                 pop     cx
  200.                 LOOP    PutByte
  201.                 pop     bx
  202.                 JMP     LineOk
  203. CrunchyNut:     SUB     CX,257
  204.                 NEG     CX
  205.                 SUB     BP,CX
  206.                 push    bx
  207.                 mov     bl,ds:[si]
  208.                 mov     bh,bl
  209.                 inc     si
  210. PutByte2:       push    cx
  211.                 mov     cx,8
  212. orpixel2:       rcl     bl,1
  213.                 jc      carry_set2
  214.                 and     es:[di],ah
  215.                 jmp     set_done2
  216. carry_set2:     or      es:[di],al
  217. set_done2:      inc     di
  218.                 loop    orpixel2
  219.                 mov     bl,bh
  220.                 pop     cx
  221.                 LOOP    PutByte2
  222.                 pop     bx
  223. LineOk:         CMP     BP,0
  224.                 JNE     NotherOne
  225.                 POP     BP
  226.                 POP     DI
  227.                 POP     CX
  228.                 SHL     AL,1
  229.                 STC
  230.                 RCL     AH,1
  231.                 LOOP    Planes
  232.                 push    bp
  233.                 push    bx
  234.                 shl     bp,3
  235.                 shl     bx,3
  236.                 ADD     DI,BP
  237.                 ADD     DI,BX
  238.                 pop     bx
  239.                 pop     bp
  240.                 POP     AX
  241.                 POP     CX
  242.                 LOOP    Depackl1
  243.                 RET
  244.  
  245. SetVgaPalette:  call    waitraster
  246.                 mov     dx,3c8h
  247.                 mov     ax,di
  248.                 out     dx,al
  249.                 inc     dx
  250.                 mov     ax,cx
  251.                 shl     cx,1
  252.                 add     cx,ax
  253.                 rep     outsb
  254.                 ret
  255. ;-------------------------------------------------------------------------------
  256. Reserve:        mov     bx,(110000/16)      ;105 KB needed to run intro!
  257.                 call    Setblock
  258.  
  259.                 mov     bx,(5000/16)        ;5 KB for all data
  260.                 call    Allocate
  261.                 mov     MusicSegment,ax
  262.                 mov     Music,ax
  263.  
  264.                 mov     bx,(65000/16)       ;65 KB for the unpacked picture
  265.                 call    Allocate
  266.                 mov     UnpackedPicSeg,ax
  267.                 ret
  268. ;-------------------------------------------------------------------------------
  269. SetBlock:       mov     ah,4ah
  270.         int    21h
  271.                 jc      SetBlockError
  272.                 ret
  273. SetBlockError:
  274.                 push    ax
  275.                 mov     ax,0003h
  276.                 int     10h
  277.                 pop     ax
  278.  
  279.                 cmp     ax,7
  280.                 jz      Set10
  281.         cmp    ax,8
  282.                 jz      Set20
  283.                 cmp     ax,9
  284.                 jz      Set30
  285.                 lea     dx,SetUnknown
  286.                 jmp     short SetBlockPrint
  287. Set10:          lea     dx,SetError7
  288.                 jmp     short SetBlockPrint
  289. Set20:          lea     dx,SetError8
  290.                 jmp     short SetBlockPrint
  291. Set30:          lea     dx,SetError9
  292.  
  293. SetBlockPrint:  mov     ah,9
  294.              int    21h
  295.                 mov     ax,4c00h
  296.                 int     21h
  297.  
  298. Allocate:       mov     ah,48h
  299.         int    21h
  300.                 jc      AllocateError
  301.                 ret
  302. AllocateError:
  303.                 push    ax
  304.                 mov     ax,0003h
  305.                 int     10h
  306.                 pop     ax
  307.  
  308.                 cmp     ax,7
  309.                 jz      Allo10
  310.         cmp    ax,8
  311.                 jz      Allo20
  312.                 lea     dx,SetUnknown
  313.                 jmp     short AllocatePrint
  314. Allo10:         lea     dx,SetError7
  315.                 jmp     short AllocatePrint
  316. Allo20:         lea     dx,SetError8
  317.  
  318. AllocatePrint:  mov     ah,9
  319.              int    21h
  320.                 mov     ax,4c00h
  321.                 int     21h
  322.  
  323. DeAllocate:     mov     ah,49h
  324.         int    21h
  325.                 jc      DeAlloError
  326.                 ret
  327. DeAlloError:
  328.                 push    ax
  329.                 mov     ax,0003h
  330.                 int     10h
  331.                 pop     ax
  332.  
  333.                 cmp     ax,7
  334.                 jz      DeA10
  335.                 cmp     ax,9
  336.                 jz      DeA20
  337.                 lea     dx,SetUnknown
  338.                 jmp     short DeAlloPrint
  339. DeA10:          lea     dx,SetError7
  340.                 jmp     short DeAlloPrint
  341. DeA20:          lea     dx,SetError9
  342.  
  343. DeAlloPrint:    mov     ah,9
  344.              int    21h
  345.                 mov     ax,4c00h
  346.                 int     21h
  347.  
  348. waitraster:     mov     dx,3dah
  349. ras1:           in      al,dx
  350.                 test    al,8
  351.                 jnz     ras1
  352. ras2:           in      al,dx
  353.                 test    al,8
  354.                 jz      ras2
  355.                 ret
  356. ;-------------------------------------------------------------------------------
  357. LogoShower:     mov     ax,@data
  358.                 mov     ds,ax
  359.  
  360.                 cmp     Book,1
  361.                 jne     Naah
  362.                 ret
  363.  
  364. Naah:           mov     cx,160
  365.                 mov     si,StartPos
  366.                 mov     di,EndPos
  367.  
  368.                 mov     ax,@data
  369.                 mov     ds,ax
  370.                 mov     ds,UnpackedPicSeg
  371.                 mov     ax,0a000h
  372.                 mov     es,ax
  373.                 rep     movsw
  374.  
  375.                 mov     ax,@data
  376.                 mov     ds,ax
  377.  
  378.                 mov     ax,Book
  379.                 inc     Antal
  380.                 cmp     Antal,ax
  381.                 jne     Reset1
  382.                 dec     Book
  383.                 mov     Antal,0
  384.                 mov     EndPos,320*9
  385.                 sbb     StartPos,320
  386. Reset1:         add     EndPos,320
  387.                 ret
  388.  
  389. Setup:          mov     ax,@data
  390.                 mov     ds,ax
  391.                 mov     ax,MusicSegment
  392.                 mov     es,ax
  393.  
  394.                 mov     cx,3900/2
  395.                 lea     si,DataBuffer
  396.                 xor     di,di
  397.                 rep     movsw
  398.  
  399.  
  400.                 mov     ah,6        ;Adlib detection
  401.                 call    Player
  402.                 jc      NoCard
  403.  
  404. Yes:            mov     Byte ptr player,90h
  405.  
  406. NoCard:         mov     ax,13h          ;Switch to 320x200 256 colors
  407.                 int     10h
  408.  
  409.                 call    ClearInit
  410.  
  411. ;-------------------------------------------------------------------------------
  412.                 CALL    DepackPicture
  413.  
  414.                 mov     ax,@data
  415.                 mov     ds,ax
  416.  
  417.                 mov     di,0
  418.                 mov     cx,256
  419.                 lea     si,PaletteData
  420.                 call    setvgapalette
  421.  
  422.                 mov     ds,UnpackedPicSeg
  423.                 mov     ax,0a000h
  424.                 mov     es,ax
  425.  
  426.                 cld
  427.                 xor     si,si
  428.                 xor     di,di
  429.                 mov     cx,160*9
  430.                 rep     movsw
  431.  
  432.                 mov     si,(320*191)
  433.                 mov     di,(320*191)
  434.                 mov     cx,160*9
  435.                 rep     movsw
  436.  
  437.                 mov     ax,@data
  438.                 mov     ds,ax
  439.                 mov     es,ax
  440.  
  441.                 lea     si,Sinus1
  442.                 lea     di,Sinus1
  443.                 mov     cx,256
  444. Calc:           lodsw
  445.                 add     ax,110
  446.                 stosw
  447.                 loop    Calc
  448.  
  449.                 lea     si,SinusData
  450.                 lea     di,SinusData
  451.                 mov     cx,40
  452. Calc2:          lodsw
  453.                 add     ax,Source-8
  454.                 stosw
  455.                 loop    Calc2
  456.  
  457.                 lea     si,SinusVar
  458.                 lea     di,SinusVar
  459.                 mov     cx,40
  460.                 mov     bl,0
  461. Calc3:          lodsb
  462.                 add     al,bl
  463.                 stosb
  464.                 add     bl,3
  465.                 loop    Calc3
  466.  
  467.                 mov     ax,@data
  468.                 mov     ds,ax
  469.                 mov     ax,0a000h
  470.                 mov     es,ax
  471.                 ret
  472. ;-------------------------------------------------------------------------------
  473. Dycp:           mov     ax,@data
  474.                 mov     ds,ax
  475.  
  476. Kwon:           mov     Rgb1,0
  477.                 mov     Rgb2,0
  478.                 mov     Rgb3,0
  479.  
  480.                 cmp     Check,0
  481.                 jne     Red
  482.                 mov     Rgb2,60
  483.                 mov     Rgb3,60
  484.                 jmp     Skib1
  485.  
  486. Red:            cmp     Check,1
  487.                 jne     Green
  488.                 mov     Rgb2,60
  489.                 jmp     Skib1
  490.  
  491. Green:          mov     Rgb3,60
  492.                 mov     Rgb1,60
  493.  
  494. Skib1:          mov     bl,15*8
  495.                 sbb     bl,ColVar
  496.  
  497.                 mov     cx,8
  498. Col2:           mov     dx,3c8h
  499.                 mov     al,bl
  500.                 out     dx,al
  501.                 inc     dx
  502.                 nop
  503.                 nop
  504.                 nop
  505.                 nop
  506.                 nop
  507.                 nop
  508.                 mov     al,Rgb1
  509.                 out     dx,al
  510.                 nop
  511.                 nop
  512.                 nop
  513.                 nop
  514.                 nop
  515.                 nop
  516.                 mov     al,Rgb2
  517.                 out     dx,al
  518.                 nop
  519.                 nop
  520.                 nop
  521.                 nop
  522.                 nop
  523.                 nop
  524.                 mov     al,Rgb3
  525.                 out     dx,al
  526.  
  527.                 cmp     Check,0
  528.                 jne     Red2
  529.                 sbb     Rgb2,Step
  530.                 sbb     Rgb3,Step
  531.                 jmp     Skib2
  532. Red2:           cmp     Check,1
  533.                 jne     Green2
  534.                 sbb     Rgb2,Step
  535.                 jmp     Skib2
  536. Green2:         sbb     Rgb3,Step
  537.                 sbb     Rgb1,Step
  538. Skib2:
  539.  
  540.                 inc     bl
  541.                 loop    col2
  542.  
  543.                 mov     dx,3c8h
  544.                 mov     al,bl
  545.                 out     dx,al
  546.                 inc     dx
  547.                 nop
  548.                 nop
  549.                 nop
  550.                 nop
  551.                 nop
  552.                 nop
  553.                 mov     al,0
  554.                 out     dx,al
  555.                 nop
  556.                 nop
  557.                 nop
  558.                 nop
  559.                 nop
  560.                 nop
  561.                 out     dx,al
  562.                 nop
  563.                 nop
  564.                 nop
  565.                 nop
  566.                 nop
  567.                 nop
  568.                 out     dx,al
  569.  
  570. Wrappie:        xor     di,di
  571.                 mov     si,StartText
  572.  
  573.                 mov     cx,40
  574. Trans:          mov     al,Text[si]
  575.                 cmp     al,0
  576.                 jne     Wrap
  577.                 mov     StartText,0
  578.                 jmp     Wrappie
  579. Wrap:           xor     ah,ah
  580.                 cmp     al,32
  581.                 jne     Space
  582.                 mov     al,26+97     ;
  583. Space:          cmp     al,'('
  584.                 jne     Para1
  585.                 mov     al,27+97     ;(
  586. Para1:          cmp     al,')'
  587.                 jne     Para2
  588.                 mov     al,28+97     ;)
  589. Para2:          cmp     al,'!'
  590.                 jne     udrob
  591.                 mov     al,29+97     ;!
  592. Udrob:          cmp     al,','
  593.                 jne     comma
  594.                 mov     al,30+97     ;,
  595. Comma:          cmp     al,'.'
  596.                 jne     Punktum
  597.                 mov     al,31+97
  598. Punktum:        cmp     al,''''  ;'
  599.                 jne     oper
  600.                 mov     al,32+97
  601. Oper:           cmp     al,'+'
  602.                 jne     Plus
  603.                 mov     al,33+97
  604. Plus:           cmp     al,'-'
  605.                 jne     Minus
  606.                 mov     al,34+97
  607. Minus:          cmp     al,'*'
  608.                 jne     Stjerne
  609.                 mov     al,35+97
  610. Stjerne:        cmp     al,'&'
  611.                 jne     og
  612.                 mov     al,36+97
  613. Og:             cmp     al,'"'
  614.                 jne     Gose
  615.                 mov     al,37+97
  616. Gose:
  617.  
  618.                 sbb     al,97
  619.                 shl     ax,1
  620.                 mov     bx,ax
  621.                 mov     ax,LetterTabel[bx]
  622.                 mov     SinusData[di],ax
  623.                 inc     si
  624.                 add     di,2
  625.                 loop    Trans
  626. ;-------------------------------------------------------------------------------
  627.                 mov     ax,0a000h
  628.                 mov     es,ax
  629.  
  630.                 mov     cx,40
  631. Lykke:          push    cx
  632.                 xor     bh,bh
  633.                 mov     di,_DI
  634.                 mov     si,_SI
  635.  
  636. Testt:          mov     bl,SinusVar[Si]
  637.  
  638.                 shl     bx,1
  639.                 mov     ax,320
  640.  
  641.                 mul     Sinus1[bx]
  642.                 add     di,ax
  643.                 push    di
  644.                 mov     di,Ditto1
  645.                 inc     SinusVar[di]
  646.                 mov     di,Ditto2
  647.                 mov     si,SinusData[di]
  648.                 pop     di
  649.                 mov     ds,UnpackedPicSeg
  650.                 mov     cx,12
  651. Husk1:          push    cx
  652.                 mov     cx,4
  653.                 rep     movsw
  654.                 add     si,312
  655.                 add     di,312
  656.                 pop     cx
  657.                 loop    Husk1
  658.  
  659.                 mov     ax,@data
  660.                 mov     ds,ax
  661.                 add     _Di,8
  662.                 add     _Si,1
  663.                 add     Ditto1,1
  664.                 add     Ditto2,2
  665.  
  666.                 pop     cx
  667.                 loop    Lykke
  668.  
  669.                 mov     _si,0
  670.                 mov     _di,0
  671.                 mov     Ditto1,0
  672.                 mov     Ditto2,0
  673.  
  674.                 cmp     First,100
  675.                 je      Cool
  676.                 inc     First
  677.                 ret
  678.  
  679. Cool:           cmp     Fade,0
  680.                 je      Op
  681.                 jmp     FadeDown
  682.  
  683. Op:             inc     Delay2
  684.                 cmp     Delay2,7
  685.                 je      Now1
  686.                 ret
  687.  
  688. Now1:           mov     Delay2,0
  689.                 cmp     ColVar,0
  690.                 je      Don1
  691.                 dec     Colvar
  692.                 ret
  693.  
  694. Don1:           mov     Pause,0
  695.                 mov     Fade,1
  696.                 mov     Delay2,0
  697.                 ret
  698.  
  699. FadeDown:       cmp     Pause,400
  700.                 je      OkayDown
  701.                 inc     Pause
  702.                 ret
  703.  
  704. OkayDown:       inc     Delay2
  705.                 cmp     Delay2,7
  706.                 je      Down1
  707.                 ret
  708.  
  709. Down1:          mov     Delay2,0
  710.                 cmp     ColVar,9
  711.                 je      Down2
  712.                 inc     ColVar
  713.                 ret
  714.  
  715. Down2:          mov     Delay2,0
  716.                 mov     fade,0
  717.                 mov     Pause,0
  718.                 add     StartText,40
  719.                 inc     Check
  720.                 cmp     Check,3
  721.                 jne     Reset
  722.                 mov     Check,0
  723. Reset:          ret
  724.  
  725. ClearInit:      mov     ah,1            ;Init player
  726.                 call    Player
  727.                 mov     ax,@data
  728.                 mov     ds,ax
  729.                 xor     ah,ah
  730.                 mov     cx,2125
  731.                 mov     bx,MusicSegment
  732.                 sub     dl,dl
  733.                 call    Player
  734.  
  735.                 mov     ah,2
  736.                 xor     bx,bx
  737.                 call    Player
  738.                 ret
  739.  
  740.                 end     Start
  741.